/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/**
 * <p>Project: app2022 - Format2
 * <p>Powered by webrx On 2022-01-05 14:01:51
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Format3 {
    public static void main(String[] args) {
        //格式化日期时间
        long t = System.currentTimeMillis();
        System.out.println(t);
        //System.out.printf("%tF %<tT %<tA %n", t);
        //2022年01月05日

        Locale.setDefault(Locale.US);
        //2022年01月05日 Wednesday
        System.out.printf("%tY年%<tm月%<td日 %1$tA %n", t);

        //20220105141737.jpg
        System.out.printf("%tY%<tm%<td%<tH%<tM%<tS.jpg %n", t);
        //日期类
        Date d = new Date();
        System.out.println(d.getTime());
        //日历 1m = 60s  1s = 1000ms
        Calendar c = Calendar.getInstance();
        //%<tD 月/日/年
        System.out.printf("%tF %<tD %<tT%n", c);
        System.out.println(String.format("%tY年%<tm月", c));
        //System.out.println(c.getTimeInMillis());


        //2022.1.5 14时21分30秒 刚刚 5分 15分 30分

        //#ff0000 %x  %02x
        System.out.printf("#%02x%02x%02x", 255, 0, 0);


    }
}
